<template>
            <a href="/tf2"><h1>transform sort</h1></a>
    <div id="main"></div>
</template>
<script>
import *  as  echarts from 'echarts'

export default {
    name: 'aaa',
    mounted() {
        let myChart = echarts.init(document.getElementById('main'),null,{
            width: 600,
            height: 400
        })
        var option = {
            dataset: [{
                source: [
                    [12, 323],
                    [23, 167],
                    [81, 284],
                    [91, 413],
                    [13, 287]
                ]},{
                    transform: [
                        {
                            type: 'filter',
                            config: {
                                dimension: 0,
                                gte: 10, // 大于等于 10
                                lte: 90  // 小于等于 90
                            },
                            print: true
                        }
                    ]
                },
                {
                    transform: [
                        {
                            type: 'sort',
                            config: {
                                dimension: 1,
                                order: 'desc'
                            },
                        }
                    ]
                }
            ],
            
            xAxis: {},
            yAxis: {},
            toolbar: {
                
            },
            series: [ {
                    type: 'bar',
                    encode: {
                        x: 0,
                        y: 1
                    },
                    datasetIndex: 1
                },
                {
                    type: 'bar',
                    encode: {
                        x: 0,
                        y: 1
                    },
                    datasetIndex: 2
                }    
            ]           
        };

        myChart.setOption(option)
    }
}
</script>
<style scoped>

</style>